var NaviTabs = function(){
	var object = {
		currUrl: null,
		tabsId: null,
		dynamicContId: null,
		tabLinks: null,
		selectedTab: null,
		
		init: function(tabsId, dynamicContId) {
			this.tabsId = tabsId;
			this.dynamicContId = dynamicContId;
			this.currUrl = window.location.href;
			
			this.styleTabs();
			this.styleTabsContent();
			this.setLinks();
		},
		
		setLinks: function(){
			this.tabLinks = [];
			var tabs = $('#'+this.tabsId + ' ul li');
			for(var i=0;i<tabs.size();i++){
				var tab = tabs[i];
				var tabLink = $(tab).find('a')[0];
				this.tabLinks.push({
					href: tabLink.href,
					linkElem: tabLink,
					tab: tab
				});
			}
		},
		
		styleTabs: function(){
			$('#'+this.tabsId).addClass('util-tabs');
		},
		
		styleTabsContent: function(){
			$('#'+this.dynamicContId).addClass('util-tabs-content');
		},
		
		setActiveFromUrl: function(){
			$.each(this.tabLinks, function(index, tabObj){
				if(tabObj.href == this.currUrl){
					$(tabObj.tab).addClass('util-tabs-link-selected');
					$(tabObj.linkElem).addClass('active');
					this.selectedTab = tabObj;
				}
			}.bind(this));
		}
	};
	
	
	return object;
}
